#pragma once

#include "../../config.hpp"
#include <thread>
#include <modbus_tcp_master.hpp>

namespace dcs {

	class sampling_svr_t {
		log_handler_t log_handler_;

		si::modbus_tcp_master_t modbus_tcp_;
		std::vector<std::uint16_t> sampling_pt_;
		std::unique_ptr<std::jthread> thr_;

	public:
		sampling_svr_t(const log_handler_t&);

		bool start(const std::string &, std::uint16_t, std::uint32_t);
		void stop();

		std::vector<std::uint16_t> samping_point() const { return sampling_pt_; }
		bool retry();
	};
}